<template>
  <div class="container">
    <!-- logo导航 -->
      <!-- logo + 按钮 -->
      <van-nav-bar fixed v-show="$route.path !== '/user'">
      <!-- 注意插槽的问题 -->
      <div slot="left" class="logo"></div>
      <van-button slot="right"
        round
        type="info"
        size="small"
        icon="search"
        @click="$router.push('/search')"
      >搜索</van-button>
      </van-nav-bar>

    <!-- 主体区域 -->
    <router-view></router-view>

    <!-- 底部的tabbar -->
      <van-tabbar route>
      <van-tabbar-item to="/" icon="home-o">
        首页
      </van-tabbar-item>
      <van-tabbar-item to="/question" icon="chat-o">
        问答
      </van-tabbar-item>
      <van-tabbar-item to="/video" icon="video-o">
        视频
      </van-tabbar-item>
      <van-tabbar-item to="/user" icon="search">
        {{$store.state.tokenInfo.token ? '我的' : '未登录'}}
      </van-tabbar-item>
    </van-tabbar>

  </div>
</template>

<script>
export default {

}
</script>

<style lang="less" scoped>
.logo {
    background: url("../assets/logo.png") no-repeat;
    background-size: cover;
    width: 100px;
    height: 30px;
  }
  .van-nav-bar .van-icon{
    color: #fff;
  }
</style>
